In CSS, does it make sense or is it legal to nest an id in another id -- such as "#main #display img

Posted by Jian Lin on Stack Overflow See other posts from Stack Overflow or by Jian Lin
Published on 2010-06-11T23:49:12Z Indexed on 2010/06/11 23:52 UTC
Read the original article Hit count: 182

Filed under:
|
|

In CSS, if it is

#main #display img { height: 80px }

that means all images within an element with id display that is within another element with id main. But does it make sense or is it legal since id seems to be just global names.

It is because SASS actually allow nesting and some code may nest it like

#main
  width: 700px

  #display
    img
      height: 80px

which is "id within id".

© Stack Overflow or respective owner

Related posts about css

Related posts about sass